import axios from "@/Request/request"
import qs from "qs";
// 获取精品推荐的数据
export const JingpinAPI = () => axios.get('/products/recommend')

// 获取热门的数据
export const RemenAPI = () => axios.get("/products/hot");

// 发送短信验证码
export const SendSMSAPI = (params) => axios.post("/sendSMS", qs.stringify(params));

// 手机号登录
export const PhoneLoginAPI = (params) => axios.post("/phoneRegin", qs.stringify(params));

// 微信登录
export const WeiXinLoginAPI = (params) => axios.post("/wechatUsers/PCLogin", qs.stringify(params));

// 手机绑定微信

export const BinddingAPI = (params) => axios.post("/wechatUsers/binding", qs.stringify(params));

// 获取用户信息
export const UserProfilesAPI = () => axios.get("/shop/userProfiles");

// 请求详情页的数据
export const GoodDetailsAPI = (id) => axios.get(`/products/${id}`);

// 加入购物车
export const AddToCartApi = (params) => axios.post("/shop/carts/add", qs.stringify(params));

// 全部商品
export const GoodsSearchAPI = (params) => axios.get("/products", { params });//params:params

// 查看购物车
export const CartDataAPI = () => axios.get("/shop/carts");

// 删除购物车商品
export const DelAPI = (params) => axios.delete(`/shop/carts?productIds=${params.id}`);
